package cn.melonlib.graphql.exceptions;

import graphql.schema.GraphQLFieldDefinition;
import lombok.Getter;

import java.util.List;

@Getter
public class GraphqlInitException extends Exception{

    private String namespace;

    private List<GraphQLFieldDefinition> queries;

    private List<GraphQLFieldDefinition> mutations;

    public GraphqlInitException(String namespace, List<GraphQLFieldDefinition> queries, List<GraphQLFieldDefinition> mutations) {
        this.namespace = namespace;
        this.queries = queries;
        this.mutations = mutations;
    }

    public GraphqlInitException(String message, String namespace, List<GraphQLFieldDefinition> queries, List<GraphQLFieldDefinition> mutations) {
        super(message);
        this.namespace = namespace;
        this.queries = queries;
        this.mutations = mutations;
    }

    public GraphqlInitException(String message, Throwable cause, String namespace, List<GraphQLFieldDefinition> queries, List<GraphQLFieldDefinition> mutations) {
        super(message, cause);
        this.namespace = namespace;
        this.queries = queries;
        this.mutations = mutations;
    }

    public GraphqlInitException(Throwable cause, String namespace, List<GraphQLFieldDefinition> queries, List<GraphQLFieldDefinition> mutations) {
        super(cause);
        this.namespace = namespace;
        this.queries = queries;
        this.mutations = mutations;
    }

    public GraphqlInitException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace, String namespace, List<GraphQLFieldDefinition> queries, List<GraphQLFieldDefinition> mutations) {
        super(message, cause, enableSuppression, writableStackTrace);
        this.namespace = namespace;
        this.queries = queries;
        this.mutations = mutations;
    }
}
